<%@ page contentType="text/html; charset=utf-8" language="java"  errorPage="" %>
<%@page import="com.netscenery.yang.model.LeafRef"%>
<%@page import="offer.GetDataSource"%>
<%@page import="operate.OperateType"%>
<%@page import="offer.SessionObj"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
LeafRef leafRef = new LeafRef();
//获取结点对象
Object itemNode = request.getAttribute("itemNode");
Object opType   = request.getAttribute("opType"); //获取操作对象
String StatusStr ="";
for(int i = 0 ; i < GetDataSource.getStatusList().length ; i ++){
	StatusStr += GetDataSource.getStatusList()[i] +"_";
}
StatusStr = StatusStr.substring(0, StatusStr.length()-1);
if( null != itemNode){
	leafRef = (LeafRef)itemNode;
}
//Session ModuleStatus control
SessionObj sessionObj = (SessionObj)request.getSession().getAttribute("sessionObj");
String control_disabled = "";
if(!sessionObj.getModuleStatus().toString().equalsIgnoreCase("EDITING")){
 	control_disabled ="disabled='disabled'";
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LeafRef</title>
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
	<link rel="stylesheet" type="text/css" href="<%=basePath%>css/items.css" />
	<link rel="stylesheet" type="text/css" href="<%=basePath%>css/subItems.css" />
    <script type="text/javascript"  src="<%=basePath%>jstree-v.pre1.0/_lib/jquery.js"></script>
    <script type="text/javascript"  src="<%=basePath%>js/index.js"></script>
    <script type="text/javascript"  src="<%=basePath%>js/StringUtil.js"></script>
</head>

<body class="body">
 <form id="LeafRefForm" method="post" action="<%=basePath %>LeafRefOpreateServlet" class="IndexFormStyle" >
   <input type="hidden"  id="nodeId" name="nodeId" value="<%=request.getAttribute("nodeId") %>"  />
   <div id="TableContent" class="typeSubContent" >
      <div class="itemTitle">
          The Type [<%=leafRef.getClass().getSimpleName() %>] information 
      </div>
      &nbsp;Type name:&nbsp;<input class="inputText" id="bits_name" name="bits_name" value="<%=leafRef.getName() %>" readonly="readonly" /><br/><br/>
      <!-- ************Patterns Length Begin******************************************************************************** -->
      <div class="inContent">
        <br/>
        <div id="BitContent" class="itemContent">
     	   <div class="patternItem">
				<div class="itemDiv">
				    <span class="textSpan">&nbsp;LeafRef&nbsp; Path:</span>
				    <input class="inputText" id="_path" name="_path" value="<%=leafRef.getPath()==null?"":leafRef.getPath() %>"  />
				    <span class="notNullSpan">(*String)</span>
				</div>
        </div><!--  patternItemContent end -->
      </div><!-- inContent end  -->
      <!-- ************Patterns Length Begin******************************************************************************** -->
   </div>
   <div id="submitContent" class="submitContent">
     <input type="button" <%=control_disabled %> onclick="fromSubmit()" value="Apply"  />
   </div>
   </form>
 <script type="text/javascript">
	 $(document).ready(function(){}
	 );
	 function fromSubmit(){
	    if($("#_path").val().trim().length != 0){
	        document.getElementById("LeafRefForm").submit();
	    }else{
	    	alert("Path 属性不能为空!");
	    	$("#_path").focus();
	    	return;
	    }
	 }
 </script>
   
</body>
</html>